<?php
 header("Content-Type: text/html; charset=utf-8"); error_reporting(E_ERROR | E_WARNING); date_default_timezone_set("Asia/chongqing"); include "Uploader.class.php"; $title = htmlspecialchars($_POST['pictitle'], ENT_QUOTES); $path = htmlspecialchars($_POST['dir'], ENT_QUOTES); $config = array( "savePath" => ($path == "1" ? "upload/" : "upload1/"), "maxSize" => 1000, "allowFiles" => array(".gif", ".png", ".jpg", ".jpeg", ".bmp") ); $up = new Uploader("upfile", $config); $info = $up->getFileInfo(); echo "{'url':'" . $info["url"] . "','title':'" . $title . "','original':'" . $info["originalName"] . "','state':'" . $info["state"] . "'}"; 